<template>
  <div :style="{color:yanse}">{{txt}}</div>
</template>
<script>
  export default{
      name:'MyHeader',
      created(){
        if(this.$props["文字颜色"]=="红色"){
            this.yanse = "red";
        }else if(this.$props["文字颜色"]=="黄色"){
            this.yanse = "yellow";
        }
      },
      data(){
          return {
            yanse:'black'
          }
      },
      props:["txt","文字颜色"]
  }
</script>
